class Solution
{
public:
    int singleNumber(vector<int>& nums)
    {
        int n = 0;
        for (auto a : nums)
        {
            n ^= a;
        }
        return n;
    }
};